<?php
	use yii\helpers\Html;
	use yii\helpers\Url;
	use frontend\models\User;
	use frontend\models\UserMessage;
	$session = Yii::$app->session;
	$uid = $session->get('user_id');
	$model = User::find()->where(["user_id"=>$uid])->one();
	$usermessage = UserMessage::find()->where(['and',['to_id'=>$uid],['message_type'=>2],['message_status'=>0]])->count();
?>
<link rel="stylesheet" type="text/css" href="/assets/css/gerenzhognxin2.css"/>
<link rel="stylesheet" type="text/css" href="/assets/style/form.css">
<div class="main">
  <h3>个人中心</h3>
    <div class="zuo">
		<dl>
			<dt>
				<img src="http://files.bwphp.com/<?php echo $model->user_thumb;?>" width="62" height="69" />
		  </dt>
			<dd>
				<p class="p1">&nbsp;&nbsp;<a href="<?php echo Yii::$app->urlManager->createUrl('center/index');?>"><?php echo $model->user_name;?>(ID：<?php echo $model->user_num;?>)</a></p>
				<p class="p2">金币：<span><?php echo $model->user_virtual;?></span></p>
			</dd>     
		</dl>
		<p class="p3">
		<?php echo $model->user_sign;?>
		</p>
		<ul>
			<li><a href="<?php echo Yii::$app->urlManager->createUrl('center/index');?>" style="color:#fd0012;">个人信息</a></li>
			<li><a href="<?php echo Yii::$app->urlManager->createUrl('center/avatar');?>">个人头像</a></li>
			<li><a href="<?php echo Yii::$app->urlManager->createUrl('center/course');?>">我的课程</a></li>
			<li><a href="<?php echo Yii::$app->urlManager->createUrl('center/wallet');?>">我的钱包</a></li>
			<li><a href="<?php echo Yii::$app->urlManager->createUrl('center/myfriend');?>">好友列表</a></li>
			<li><a href="<?php echo Yii::$app->urlManager->createUrl('center/system');?>">系统消息</a>
			<?php if($usermessage>0){?>
			(<span><?php echo $usermessage;?></span>)
			<?php }?>
			</li>
			<li><a href="<?php echo Yii::$app->urlManager->createUrl('center/answer');?>">我的回答</a></li>
			<li><a href="<?php echo Yii::$app->urlManager->createUrl('center/comment');?>">我的评论</a></li>
			<li><a href="<?php echo Yii::$app->urlManager->createUrl('center/message');?>">文章收藏</a></li>
			<li style="border:none;"><a href="<?php echo Yii::$app->urlManager->createUrl('center/liketeacher');?>">喜欢教师</a></li>
		</ul>
	</div>